package com.tcfvic.server.tools;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import jxl.write.Label;
import jxl.write.WritableCell;

final public class ExcelCellGeneratorFactory {
	private ExcelCellGeneratorFactory() {
	}

//	private static final WritableCellFormat DATE_FORMAT = new WritableCellFormat(
//			new DateFormat("dd MMM yyyy")); // reusing this field fails
	public static final DateFormat formater = new SimpleDateFormat("dd/MM/yyyy");

	static public ExcelCellGenerator createDateCellGenerator() {
		return new ExcelCellGenerator() {
			public WritableCell getCell(int col, int row, final Date date) {
				return new Label(col, row, formater.format(date));
			}
		};
	}
}